const mysql = require("mysql");

// 连接数据库的通用配置
const HOST = 'localhost',
    USER = 'root',
    PWD = 'LJ369JJJ521',
    DB = 'lx_music';

// 创建数据库连接对象
const conn = mysql.createConnection({
    host: HOST,
    user: USER,
    password: PWD,
    database: DB,
});
// 连接数据库
conn.connect();

// 导出数据库连接对象
exports.conn = conn;